import http
import random
from Utils.gy import step_change
from Utils.router import router


@router.get("/util/step_wr/{step_num}", tags=['移动端私人工具'], summary='微信_支付宝刷步数')
async def step_changes(step_num: str):
    user = '18360500891'
    # 登录密码
    passwd = 'pp19970405'
    # 要修改的步数，直接输入想要修改的步数值，留空为随机步数
    step = step_num

    user_list = user.split('#')
    passwd_list = passwd.split('#')
    setp_array = step.split('-')

    if len(user_list) == len(passwd_list):
        push = ''
        for line in range(0, len(user_list)):
            if len(setp_array) == 2:
                step = str(random.randint(int(setp_array[0]), int(setp_array[1])))
            elif str(step) == '0':
                step = ''
            push += step_change.main(user_list[line], passwd_list[line], step) + '\n'
        return {'code': http.HTTPStatus.OK, 'msg': '已成功修改步数为：' + str(step)}
    else:
        return {'code': http.HTTPStatus.OK, 'msg': '修改失败，请检查是否账号密码有误'}
